package games.mapacman.common;

import marauroa.common.game.Definition;
import marauroa.common.game.RPClass;
import marauroa.common.game.Definition.Type;

public class Common {

	public static void initRPClasses() {
                RPClass pos = null;
                try{
                    pos = new RPClass("position");
                } catch (IllegalArgumentException argumentException){
                    argumentException.printStackTrace();
                    return;
                }

                pos.addAttribute("x", Type.INT);
		pos.addAttribute("y", Type.INT);

		RPClass player = new RPClass(Constants.TYPE_PLAYER);
		player.isA("position");
		player.addAttribute("text", Type.LONG_STRING, Definition.VOLATILE);
		player.addAttribute("score", Type.INT);
		player.addAttribute("power", Type.INT);
		player.addAttribute("name", Type.STRING);
		player.addAttribute("dir", Type.BYTE, Definition.VOLATILE);
		player.addAttribute("nextdir", Type.BYTE, Definition.VOLATILE);

		RPClass ghost = new RPClass(Constants.TYPE_GHOST);
		ghost.isA("position");
		ghost.addAttribute("dir", Type.BYTE);
		ghost.addAttribute("nextdir", Type.BYTE);
		ghost.addAttribute("!changedir", Type.INT, Definition.HIDDEN);
		ghost.addAttribute("color", Type.BYTE);

		RPClass wall = new RPClass(Constants.TYPE_WALL);
		wall.isA("position");

		Dot.initRPClass();
		Superdot.initRPClass();
		Fruit.initRPClass();
		Powerpill.initRPClass();
		ZoneChangePoint.initRPClass();
		EatenSign.initRPClass();
		ScoreSign.initRPClass();

	}

}
